What is define insanity?

Insanity is a legal term that refers to a person's mental state and their ability to understand and comprehend their actions and reality. It is defined as a severe mental disorder that impairs a person's judgment, thinking, and behavior, making them unable to conform to society's norms and expectations. It is typically diagnosed by a mental health professional and often requires specialized treatment. In a legal context, insanity can also be used as a defense in criminal trials, where the defendant argues that they were not aware that their actions were wrong or criminal due to their mental state at the time of the crime.